package com.xin.springcloudconsumer.feigns;

import com.xin.springcloudconsumer.form.EventForm;
import com.xin.springcloudconsumer.vo.ResultVO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.text.ParseException;

@FeignClient("springcloud-quartz")
public interface EventFeign {
    /**
     * 创建新事件
     * @param eventForm
     * @return
     */
    @PostMapping("/add")
    public ResultVO add(@RequestBody(required = false) EventForm eventForm);

    /**
     * 修改事件
     * @param eventForm
     * @return
     */
    @PostMapping("/update")
    public ResultVO update(@RequestBody(required = false)EventForm eventForm,
                           @RequestParam(name = "id") String id);


    /**
     * 删除事件
     * @param id
     * @return
     */
    @GetMapping("/delete")
    public ResultVO delete(@RequestParam(name = "id",defaultValue = "")String id);

    /**
     * 查询某个事件
     * @param id
     * @return
     */
    @GetMapping("/findOne")
    public ResultVO findOne(@RequestParam(name = "id",defaultValue = "")String id);

    /**
     * 查询某人的全部事件
     * @param openId
     * @param
     * @return
     */
    @GetMapping("/findAll")
    public ResultVO findAll(@RequestParam(name = "openId",defaultValue = "")String openId,
                            @RequestParam(name = "page",defaultValue = "")Integer page,
                            @RequestParam(name = "size",defaultValue = "")Integer size);

}
